<?php
//require_once 'Zend/View/Helper/Abstract.php';
class Zend_View_Helper_Curl extends Zend_View_Helper_Abstract
{
    public function curl ($toAdd = array(), $site_url='')
    {
        $requestUri = \Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
        $query = parse_url($requestUri, PHP_URL_QUERY);
        $path = parse_url($requestUri, PHP_URL_PATH);
                
        $params = urldecode($query);
        parse_str($params, $params);
        
        foreach ($toAdd as $key=>$item){
            $params[$key] = $item;
        }
        
        $result_url = http_build_query($params);
        $result_url = htmlentities($result_url);
        
        return $site_url.$path.'?'.$result_url;
    }
}
